﻿using System;
using Ninject.Extensions.Interception.Infrastructure.Language;
using Ninject.Extensions.Interception;
using Ninject.Modules;
using NInject.Practice.Interceptor;

namespace NInject.Practice.NinjectModules
{
    public class MyServiceModule: NinjectModule 
    {
        public override void Load()
        {
            Bind<IMyService>().To<MyService>();

            //http://baharestani.com/2013/12/30/interception-with-ninject/
            Bind<ICustomerService>().To<CustomerService>().Intercept().With<LoggingInterceptor>();

            //http://blog.simplecode.eu/post/Creating-a-simple-logging-Interceptor-using-NInject-302
            //Kernel.InterceptAround<ICustomerService>(s => s.GetCustomer(), i => Console.WriteLine("before invoke"), i => Console.WriteLine("after invoke"));


        }
    }
}